<?php echo $this->Html->script('getCategory.js', array('inline' => false)) ?>
<div class="row">
    <div class="col-md-2">
        <h2><kbd><?php echo __('Actions'); ?></kbd></h2>
        <hr/>
        <ul class="nav navbar-inverse">

            <li><?php echo $this->Form->postLink(__('Delete'), array('action' => 'delete', $this->Form->value('Transaction.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Transaction.id'))); ?></li>
            <li><?php echo $this->Html->link(__('List Transactions'), array('action' => 'index')); ?></li>
            <li><?php echo $this->Html->link(__('List Categories'), array('controller' => 'categories', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Category'), array('controller' => 'categories', 'action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Wallets'), array('controller' => 'wallets', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Wallet'), array('controller' => 'wallets', 'action' => 'add')); ?> </li>
            <li><?php echo $this->Html->link(__('List Transactions'), array('controller' => 'transactions', 'action' => 'index')); ?> </li>
            <li><?php echo $this->Html->link(__('New Parent Transaction'), array('controller' => 'transactions', 'action' => 'add')); ?> </li>
        </ul>
    </div>
    <div class="transactions col-md-10">
        <?php echo $this->Form->create('Transaction', array('class' => 'form-horizontal', 'inputDefaults' => array('label' => false))); ?>
        <fieldset>
            <h2><kbd><?php echo __('Edit Transaction'); ?></kbd></h2>
            <hr/>
            <div class="form-group">
                <label class="col-md-2 control-label">Type</label>

                <div class="col-md-4">
                    <?php
                    $type = $currentCategory['type'] + 1;
                    $options = array('1' => 'Spent on', '2' => 'Earn from');
                    echo $this->Form->input('type', array('class' => 'form-control', 'options' => $options, 'default' => $type));
                    ?>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-2 control-label">Category</label>

                <div class="col-md-4">
                    <?php
                    $options = array();
                    foreach ($categories as $key => $value) {
                        $options[$key] = $value;
                    }

                    echo $this->Form->input('category_id', array('class' => 'form-control', 'options' => $options, 'default' => $currentCategory['id']));
                    ?>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">Wallet</label>

                <div class="col-md-4">
                    <?php echo $this->Form->input('wallet_id', array('class' => 'form-control')); ?>
                </div>
            </div>

            <div class="form-group">
                <label class="col-md-2 control-label">Money</label>

                <div class="col-md-4">

                    <div class="input-group input-group-sm">
                        <?php echo $this->Form->input('money', array('class' => 'form-control')); ?>
                        <span class="input-group-addon">VNĐ</span>
                    </div>


                </div>
            </div>


            <div class="form-group">
                <label class="col-md-2 control-label">With Who</label>

                <div class="col-md-4">
                    <?php echo $this->Form->input('with_who', array('class' => 'form-control')); ?>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-4 col-sm-offset-2">
                    <?php echo $this->Form->Submit('Submit', array('class' => 'btn btn-danger')); ?>
                </div>
            </div>


        </fieldset>
        <?php echo $this->Form->end(); ?>
    </div>


</div>
